// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:single_child_scroll_demo/main.dart';

void main() {
  testWidgets('SingleChildScrollView displays alphabet letters', (
    WidgetTester tester,
  ) async {
    // Build our app and trigger a frame.
    await tester.pumpWidget(const MyApp());

    // Verify that the app title is displayed
    expect(find.text('SingleChildScrollView 示例'), findsOneWidget);

    // Verify that some alphabet letters are displayed
    expect(find.text('A'), findsOneWidget);
    expect(find.text('B'), findsOneWidget);
    expect(find.text('Z'), findsOneWidget);

    // Verify that SingleChildScrollView is used
    expect(find.byType(SingleChildScrollView), findsOneWidget);

    // Verify that Scrollbar is used
    expect(find.byType(Scrollbar), findsOneWidget);
  });
}
